1. Field of the Invention
The present invention relates generally to a communication interface, and more particularly to an apparatus and method for automatically identifying between USB and PS/2 interface.
2. Related Art
USB is a standard interface for the connections or communications between computer systems and their peripherals. Although currently more and more peripherals support USB interfaces, those with low transmission rate, such as keyboard and mouse, will be more accepted in the market if they can support conventional PS/2 interfaces as well.
FIG. 1 is a system block diagram to show a host computer 10 connected to a peripheral 12, such as microcontroller unit (MCU), that supports USB and PS/2 transmission function and includes a mechanism 14 capable of handling USB transmission specification and a mechanism 16 capable of handling PS/2 transmission specification both connected to the host computer 10 but exclusive to each other at same time through first and second ports 18 and 20. The first port 18 is provided for the transmission of the signal D+ of USB interface or the clock of PS/2 interface, and the second port 20 is for the transmission of the signal D− of USB interface or data signal of PS/2 interface. The USB mechanism 14 needs a USB transceiver 22 to be connected to the first and second ports 18 and 20 with connection of the receiver signal RxD+ port 24 and RxD− port 26 and the transmitter signal TxD+ port 28 and TxD− port 30 to and from the USB mechanism 14, and the PS/2 mechanism 16 is directly connected to the first and the second ports 18 and 20 with its clock port 32 and data port 34.
To ensure the peripheral 12 to communicate with the host computer 10 with the same transmission interface specification, the USB or PS/2 interface must be identified according to the logic states of the first and second ports 18 and 20 when it is initially connected to the host computer, and then the USB or PS/2 transmission mechanisms 14 or 16 is responsible to interactive to the host computer 10.
USB interface standard covers low-speed device and high-speed device. FIG. 2 shows the connection of a USB low-speed device 38 to a host computer 36 through a cable 40 on their respective D+ ports 42 and 46 and D− ports 44 and 48. At the side of the host computer 36, there are two 15 KΩ pull-down resistors Rpd connected from the D+ signal port 42 and D− signal port 44 to ground, and at the side of the low-speed device 38 a 1.5 KΩ pull-up resistor Rpu connected between supply voltage 3.3 V and the D− signal port 48. On the other hand, the only difference between USB full-speed device and the above-mentioned low-speed device is that the pull-up resistor Rpu is connected to the D+ signal port for full-speed device.
Conventionally, the identification of USB and PS/2 interface utilizes the characteristics of the direct connection of the pull-down resistor Rpd on the USB port of the host computer. Referring to FIG. 1 and FIG. 2 at same time, in accordance with USB interface standard, when the peripheral 12 is connected to the host computer 10, initially the pull-up resistor Rpu will not be connected onto the port, as a result, if the first and second ports 18 and 20 are both logic “0” at this time, it is determined a USB interface is connected thereto, otherwise, it is a PS/2 interface. The drawback of this method is that the PS/2 port at the side of the host computer 10 may be floating or in high impedance, which will result in uncertain level of the D+ and D− ports 18 and 20 when the peripheral 12 is connected thereto and, as a result, the misjudgment of the interface type.
Therefore, it is desired an apparatus and method to correctly and automatically identify between USB and PS/2 interface.